package com.xx.controller;

import com.xx.domain.Permission;
import com.xx.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Author : 徐闯 ssm_admin
 * @Date : 2021-05-18 14:05:36
 * @Description : 资源权限操作的控制器
 **/
@Controller
@ResponseBody
@RequestMapping("/permission")
public class PermissionController {
    @Autowired
    private PermissionService permissionService;
    @RequestMapping("/findAll")
    public List<Permission> findALl(){
        return permissionService.fundAll();
    }

    @RequestMapping("/deleteOne")
    public int deleteOne(int pId){
        return permissionService.deleteOne(pId);
    }

    @RequestMapping("/deleteAll")
    public int deleteAll(int pIds[]){
        return permissionService.deleteALl(pIds);
    }

    @RequestMapping("/insertOne")
    public int insertOne(Permission permission){
        return permissionService.insertOne(permission);
    }

}
